package cn.raven.feign;

import cn.raven.entity.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserFallbackFactory implements FallbackFactory<UserFeignClient> {
    @Override
    public UserFeignClient create(Throwable throwable) {
/*        return new UserFeignClient() {
            @Override
            public User getUser(Long id) {
                return User.builder().age("瓦了瓦了").build();
            }
        };*/
        return id -> User.builder().age("瓦了瓦了").build();
    }
}
